<?php
$arr = array('id' => 1, 'name' =>'lisi');
echo $arr->name, '<br/>';

// 对象遍历
class A {}
$obj = new A();
$obj->id = 2;
$obj->name = "zhangsan";
foreach ($obj as $v) {
    echo $v . " ";
}